//编写一子函数，和客户端进行通信
//参数1:连接好的socket对象
//返回值:通信结束返回-1,不结束返回0
#include"../include/p.h"
int tcp_com(int newfd)
{
	char buf[50]={'\0'};
	char cmd[50]={'\0'};
	char filename[50]={'\0'};
//	recv(newfd,buf,sizeof(buf),0);//从网络中读取数据
//	bzero(buf,sizeof(buf));
	recv(newfd,buf,sizeof(buf),0);
	printf("read<<<:%s\n",buf);
	if(strncasecmp(buf,"quit",4)==0)
		return -1;
	parseStr(buf,cmd,filename);
	printf("cmd=%s\n",cmd);
	printf("filename=%s\n",filename);
	do_work(newfd,cmd,filename);
	printf("do work 成功！\n");
	return 0;
}
